﻿using UnityEngine;
using System.Collections;

namespace Room
{

    public class RCAIChariotAttack : RCAIChariotBase
    {
        protected override void OnEnter()
        {
            
        }

        protected override void OnTick()
        {
            if( !controller.owner.lod.IsPlayingAnim(ChariotAnimation.Attack) ||
                !controller.owner.lod.IsPlayingAnim(ChariotAnimation.AttackWeak))
            {
                if (controller.IamAniWeak)
                {
                    if (!controller.owner.lod.IsPlayingAnim(ChariotAnimation.StandWeak))
                        controller.owner.PlayAnim(ChariotAnimation.StandWeak, WrapMode.Loop);
                }
                else
                {
                    if (!controller.owner.lod.IsPlayingAnim(ChariotAnimation.Stand))
                        controller.owner.PlayAnim(ChariotAnimation.Stand, WrapMode.Loop);
                }
            }
        }

        protected override void OnLeave()
        {
            
        }

    }
}